package com.qf.pay;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000116675003";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCn9i5C3N5JqeVVvSVOAaot09drFN67QuVjXGtRIq57tqSPT9cmExuTwOr/DgMfWkUhttkWJtzIE56EJ7+qP2Eus9iWMPb1iHdhizARkifWdpOYA1sRTONls7SMNm+Q3rvdfkrIiBNW6nufd4ZnpvOfCvah8zuX/BJc4JLWqXmdenuPhZcIHmWxQwxPpYMdBHTNe6PPKY2/cMA95/QM/e89EiTeih4xyKlc6LadOBe/EEvB6zOfl79kOOMMU5Oj5kI8VavhtkwrFKTUK7NK55gGsy3Ayao0diAkXvTGN9DhO4l3BFWO8Xe8b7VhPZcZ3JhmisX2Mw6r+Jg+mV6XgPwdAgMBAAECggEAJT71UURzUriHL7UrAZpi55izi35sSfByt871yV88fBirc1BMMJhKJEDCm966mIhHDkvi5gOmMAQRwdKisRku7tFY9S1UhmxFtO7NsQfNJ8TRxALyfeqj/piUMAeeQ+zwkhSAdumeCEclNN6ngnLGUX135b/vdiui0s/GIC4i1uXG53n6M4UiepLusbwhKWrVHJquCyg0P8HZn190N1nRy+FaIe42W2dzLAgoa8tk9c8QO6Z/0fsAMpyT4VtUW36F6zpGof7T3Iy8ZjSrFtaa943JCyIRd4F7PQXAaVoCJ0T5ya+VfK8nCZZTY6L75uRst7qpOOfogw3XUdL2luKbzQKBgQDmfUn5K2hveMRCs2R3+0/DYAqvmkG1xFbhVUW9RmbG8s1tD+UHx7R2Yo80IXzCM1kHeChTzW8X0qKEsw0XFNbN122OrFEtJd9iUZ2UMId7k5hPxTk8/h/4T7ub+nYKHzX88TmPC9AXQOp1kdlnMW/K5BnnfaIMOrogk/PG84AhewKBgQC6jTk1hO3NN8iOBj9EJF2lyzpD6vQCL/HOrmoZfDyPd4ldHqoDxEoFSyTrsvVTzFziDcldsJrwJlDDP8PXLIYRPkX8wb5uokVubOewYiCGLCxiM/K1TPkL+OhfatlWI8h59liOYscfQijOQ5LpFHB5PHwXN354muE96aImbmEpRwKBgQDkx7nUTITmGK5eMqhn+5ipqjwRH4FXxaIjGjwV6rp7gWfseFlyhoSW+a+BJDgsn0Egi+EjhYde0yGjrAIzRekM+mdxtZMByFTZx38tJ5pjTBZkH7R32Rqso5/p7Aqcc2xoPJxQY35Shony1yk/J6/6aL1ZrLdbgjNbwN+5O9uT3wKBgGOAqB8Pw/dN5b87PcuOyhSAjZdkXro78HIZPaZSScsMK0xr6qsPq5ufNRYy4f/MZU59pAZBCKNHDJTYEhFXQjs4SARFItnH29jGZd4CuO5X6WSH6NEjOUNVhDxAtaPoeinzZ9CqhyL5GuLJ0DZaHJPN2zJW+zJBChsH3uE4xsJJAoGBAMz7c32Mhn4RM3jrq3mnCXx48fsOGuVAuPuwBTOsYh83V+1+orlY4zAwcJkF+1CORq+O9l4fakMxh7PQgUscATawL7+SFdOoTFLtUpVal6TZmUs5xcTA+EkBWpzzJ8xhkj0kj+SCFcJc1u3fXee4+k2JtEvSvCgMg/EmzftIrgpM";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyTkZ4O6T1bfMVsp13A/RsIeoy5MvY75KiRKUxQZWZGi1+1L2udSOuXQmcyuoHeO0Yl6xAqza4kw/uZCoZjWc4u3l8uvjkhD57XTYWOPSCDbPhj7O4/Dj9APZf0EYj2TJTltg79ctxMZA1kKLjWonIdjH+W38fMNbuaKlSNaJq5QINNlzyiA5AjsC3A9d6RtIyq/yaQdG46sLuQTRvf786rKm7ZSE8WQWf+SRyCqs+NHSkisz4Dfgtp4yujJ0dyvJyBSlN5cUXg26GTSOvQhU8uu2iFaskYkGrD4JJ/42abSZrR0mzfTZrwle1I8kaoPp+QU6uToLvLvEuV7BuBZq7wIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://wsl.kiwi1024.com/pay";
//    public static String notify_url = "http://wsl.free.idcfengye.com/pay";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://wsl.kiwi1024.com/showOrder.jsp";
//    public static String return_url = "http://wsl.free.idcfengye.com/showOrder.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

